package pers.xx.sbm.service.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pers.xx.sbm.dao.BaseDictMapper;
import pers.xx.sbm.entity.BaseDict;
import pers.xx.sbm.enums.ResultEnum;
import pers.xx.sbm.service.DictService;
import pers.xx.sbm.vo.ResResult;

import java.util.List;

/**
 * @author ：xiexing
 * @description：字典操作接口实现类
 * @date ：2020/10/9 14:33
 */
@Service
public class DictServiceImpl extends BaseServiceImpl<BaseDict> implements DictService {
    BaseDictMapper baseDictMapper;

    public DictServiceImpl(@Autowired BaseDictMapper baseDictMapper) {
        super.dao = baseDictMapper;
        this.baseDictMapper = baseDictMapper;
    }

    /**
     * @description 获取所有的字典信息
     * @author XieXing
     * @date 2020/10/10 9:38
     */
    @Override
    public ResResult<BaseDict> selectAll() {
        List<BaseDict> baseDicts = baseDictMapper.getListSelective(null);
        ResResult resResult = new ResResult();
        resResult.setResult(ResultEnum.SUCCESS, baseDicts);
        return resResult;
    }
}
